From b5deac7be19fb42d82769494cf278b6e7b33b6f7 Mon Sep 17 00:00:00 2001 From: "gm281@boulderdash.cl.cam.ac.uk" Date: Thu, 5 Aug 2004 10:01:27 +0000 Subject: [PATCH] bitkeeper revision 1.1150 (41120577g9fFRK1fSLMW6p4QnOuLrQ) Overflows in the printing routine fixed. --- xen/common/vsprintf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/common/vsprintf.c b/xen/common/vsprintf.c index fd304b9391..cfda9601d1 100644 --- a/xen/common/vsprintf.c +++ b/xen/common/vsprintf.c @@ -123,7 +123,7 @@ static int skip_atoi(const char **s) #define SPECIAL 32 /* 0x */ #define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ -static char * number(char * buf, char * end, long num, int base, int size, int precision, int type) +static char * number(char * buf, char * end, long long num, int base, int size, int precision, int type) { char c,sign,tmp[66]; const char *digits; @@ -163,7 +163,7 @@ static char * number(char * buf, char * end, long num, int base, int size, int p else { /* XXX KAF: force unsigned mod and div. */ - unsigned long num2=(unsigned long)num; + unsigned long long num2=(unsigned long long)num; unsigned int base2=(unsigned int)base; while (num2 != 0) { tmp[i++] = digits[num2%base2]; num2 /= base2; } } -- 2.30.2